A Data Driven Approach for Algebraic Loop Invariants

نویسندگان

  • Rahul Sharma
  • Saurabh Gupta
  • Bharath Hariharan
  • Alexander Aiken
  • Percy Liang
  • Aditya V. Nori
چکیده

We describe a Guess-and-Check algorithm for computing algebraic equation invariants of the form ∧ifi(x1, . . . , xn) = 0, where each fi is a polynomial over the variables x1, . . . , xn of the program. The “guess” phase is data driven and derives a candidate invariant from data generated from concrete executions of the program. This candidate invariant is subsequently validated in a “check” phase by an off-the-shelf SMT solver. Iterating between the two phases leads to a sound algorithm. Moreover, we are able to prove a bound on the number of decision procedure queries which Guess-and-Check requires to obtain a sound invariant. We show how Guess-and-Check can be extended to generate arbitrary boolean combinations of linear equalities as invariants, which enables us to generate expressive invariants to be consumed by tools that cannot handle non-linear arithmetic. We have evaluated our technique on a number of benchmark programs from recent papers on invariant generation. Our results are encouraging – we are able to efficiently compute algebraic invariants in all cases, with only a few tests.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Data-Driven Loop Invariant Inference with Automatic Feature Synthesis

We present LOOPINVGEN, a tool for generating loop invariants that can provably guarantee correctness of a program with respect to a given specification. We extend the data-driven approach to inferring sufficient loop invariants from a collection of program states. In contrast to existing data-driven techniques, LOOPINVGEN is not restricted to a fixed set of features – atomic predicates that are...

متن کامل

Generating Loop Invariants by Computing Vanishing Ideals of Sample Points

Loop invariants play a very important role in proving correctness of programs. In this paper, we address the problem of generating invariants of polynomial loop programs. We present a new approach, for generating polynomial equation invariants of polynomial loop programs through computing vanishing ideals of sample points. We apply rational function interpolation, based on early termination tec...

متن کامل

On Template-Based Inference of Rich Invariants in Leon

We present an approach for inferring rich invariants involving user-defined recursive functions over numerical and algebraic data types. In our approach, the developer provides the desired shape of the invariant using a set of templates. The templates are quantifier-free affine predicates with unknown coefficients. We also provide an enumeration based strategy for automatically inferring some o...

متن کامل

Synthesis for Polynomial Lasso Programs

We present a method for the synthesis of polynomial lasso programs. These programs consist of a program stem, a set of transitions, and an exit condition, all in the form of algebraic assertions (conjunctions of polynomial equalities). Central to this approach is the discovery of non-linear (algebraic) loop invariants. We extend Sankaranarayanan, Sipma, and Manna’s template-based approach and p...

متن کامل

no-homomorphism conditions for hypergraphs

In this paper, we define some new homomorphism-monotone parameters for hypergraphs. Using these parameters, we extend some graph homomorphism results to hypergraph case. Also, we present some bounds for some well-known invariants of hypergraphs such as fractional chromatic number,independent numer and some other invariants of hyergraphs, in terms of these parameters.

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013